package com.lipiao.traveltreasure.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 日志工具类-使用默认的slf4j+logback
 * 单例模式-饿汉
 * LogUtil.getInstance() //初始化
 * LogUtil.getLogger().  //使用
 */
public class LogUtil {

    //单例LogUtil
    private static LogUtil logUtil = new LogUtil();

    //记录器
    private static Logger logger;

    public LogUtil() {
        logger = LoggerFactory.getLogger(getClass());
    }

    //初始化
    public static LogUtil getInstance() {
        return logUtil;
    }

    //调用
    public static Logger getLogger() {
        return logger;
    }
}
